<div id="container" class="clearfix">
    <link rel="stylesheet" th:href="@{/lib/vertical_timeline/css/style.css}" />
    <div class="ces-hgruop">
        <div class="ces-header">
            <div class="ces-cell">
                <img th:src="@{/src/img/live/cesasia2015/cesdescbanner.png}" />
            </div>
            <ul class="ces-cell mid-cell">
                <li class="ces-logo"><img th:src="@{/src/img/live/cesasia2015/cesgotop.png}" /></li>
                <li>大会第一天：5月25日（星期一）上午9点 – 下午5点</li>
                <li>大会第二天：5月26日（星期二）上午9点 – 下午5点</li>
                <li>大会第三天：5月27日（星期三）上午9点 – 下午3点（公众开放日）</li>
                <li><a target="_blank" href="http://www.cesasia.cn/wp-content/uploads/2015/05/CES-Asia-2015-floor-plan-N1-N2-0515-show-guide.pdf">N1展厅</a>：机器人产品/智能家居/健身及运动/视频及4K超高清设备/电子游戏/可穿戴设备/健康产品/家庭娱乐/生活科技</li>
                <li><a target="_blank" href="http://www.cesasia.cn/wp-content/uploads/2015/05/CES-Asia-2015-floor-plan-N1-N2-0515-show-guide.pdf">N2展厅</a>：3D 打印/汽车电子/移动设备/绿色科技 位于 <a target="_blank" href="http://www.cesasia.cn/wp-content/uploads/2015/04/2015-CES-Asia-SVM-4.15.pdf">上海新国际博览中心</a></li>
            </ul>
            <div class="ces-cell ces-code">
                <img th:src="@{/src/img/wechatbarcode.png}" /> <span>微信扫一扫关注范客</span>
            </div>
        </div>
    </div>
    <section class="cd-container ces-live clearfix">
        <div class="ces-date">
            <div class="pos-fix" id="posfix">
                <div class="ces-tit">
                    <div class="ces-1">
                        <span>CES Asia 2015 上海</span>
                    </div>
                </div>
                <span> <input type="radio" name="cesDate" id="cesdate3"
                value="27" /> <label for="cesdate3">2015-05-27</label>
            </span> <span> <input type="radio" name="cesDate" id="cesdate2"
                value="26" /> <label for="cesdate2">2015-05-26</label>
            </span> <span> <input type="radio" name="cesDate" id="cesdate1"
                value="25" /> <label for="cesdate1">2015-05-25</label>
            </span>
            </div>
        </div>
        <div class="ces-msg" id="cd-timeline">
            <div class="ces-tit">
                <div class="ces-2">
                    <span>直播</span> <a href="#" class="refresh" id="refresh-live" th:onclick="'javascript:refresh();return false;'" title="刷新消息"><i
                    class="fa fa-refresh"></i></a>
                </div>
            </div>
            <div class="cd-timeline-block" th:if="${timelines.size()>0}" th:each="timeline : ${timelines}">
                <div th:switch="${timeline.type}">
                    <div th:case="'text'" class="cd-timeline-img cd-picture">
                        <img th:src="@{/lib/vertical_timeline/img/cd-icon-location.svg}" alt="Location" />
                    </div>
                    <div th:case="'image'" class="cd-timeline-img cd-picture">
                        <img th:src="@{/lib/vertical_timeline/img/cd-icon-picture.svg}" alt="Picture" />
                    </div>
                    <div th:case="*" class="cd-timeline-img cd-picture">
                        <img th:src="@{/lib/vertical_timeline/img/cd-icon-movie.svg}" alt="Movie" />
                    </div>
                </div>
                <div class="cd-timeline-content">
                    <h2>
                    <img th:src="@{/src/img/live/cesasia2015/cesavatar.png}" />范客直播君@CESASIA2015:
                </h2>
                    <div th:switch="${timeline.type}">
                        <p th:case="'text'" th:text="${timeline.content}">CES Asia 2015 上海
                        </p>
                        <img th:case="'image'" th:src="${timeline.content}" alt="CES Asia 2015 上海" />
                        <video th:case="*" controls="" width="430">
                            <source th:src="${timeline.content}" type="video/mp4" /> Your browser does not support HTML5 video.
                        </video>
                    </div>
                    <a href="#0" class="cd-read-more" title="分享" id="share-panel"> <i class="fa fa-share-alt"></i>分享
                    </a> <span class="cd-date" th:text="${#dates.format(timeline.createTime, 'yyyy-MMM-dd HH:mm')}">2015-05-25</span>
                    <span class="qDate" th:attr="data-date=${#dates.day(timeline.createTime)}" style="display: none" th:text="${#dates.year(timeline.createTime)} + '.' + ${#dates.month(timeline.createTime)} + '.' + ${#dates.day(timeline.createTime)} + ' ' + ${#dates.hour(timeline.createTime)} + ':' + ${#dates.minute(timeline.createTime)} + ':' + ${#dates.second(timeline.createTime)}">2015.05.25
                    00:00:00</span>
                </div>
            </div>
        </div>
    </section>
</div>
<script type="text/javascript" charset="utf-8" th:inline="javascript">
bShare
    .addEntry({
        title: " [来自范客生活的CESASIA2015现场直播]",
        summary: "快到范客生活来看CESASIA2015直播吧，3D打印，无人机，各种新潮炫酷的智能硬件，尽在范客生活，跟朋友分享有更多好礼等着你哦。",
        vUid: "4905443",
        vEmail: "contact@faxsun.com",
        vTag: 'FAXSUN'
    });
</script>
<script th:src="@{/lib/vertical_timeline/js/main.js}"></script>
<script th:inline="javascript">
var checkAnyNewId;
$(document).ready(function() {
    $("#refresh-live").hide();
    //checkAnyNewId = setInterval(checkAnyNew, 30000);
});

var pathArray = window.location.pathname.split('/');
var context = pathArray[1];
var checkNewUrl = [
    [@{
        /live/cesasia
        2015 / checkAnyNew
    }]
];

var refresh = function() {
    window.location.href = [
        [@{
            /live/cesasia
            2015
        }]
    ];
};

var checkAnyNew = function() {
    var qDate = $(".qDate").first();
    $.ajax({
        type: "POST",
        data: {
            "qDate": qDate.text()
        },
        url: checkNewUrl,
        success: function(data) {
            if (data == 'true') {
                $("#refresh-live").show();
                clearInterval(checkAnyNewId);
            } else {
                $("#refresh-live").hide();
            }
        },
        error: function(xhr, error) {
            alert(error + "-更新出错，请稍后再试");
        }
    });
}
</script>
